﻿using Microsoft.Xrm.Client;
using Microsoft.Xrm.Client.Services;
using Microsoft.Xrm.Sdk;



namespace Crm2011.Framework.Core
{
    public static class ServiceFactory
    {
        public static IOrganizationService GetOrganizationService(string connectionString)
        {
            return GetOrganizationService( new CrmConnectionString(connectionString));
        }


        public static IOrganizationService GetOrganizationService(CrmConnectionString crmConnectionString)
        {
            CrmConnection crmConnection = CrmConnection.Parse(crmConnectionString.GetConnectionStringClearText());
            return new OrganizationService(crmConnection);
        }
    }
}